﻿@using CashOrCard.Helper
@if (Request.IsAuthenticated) {
    <div class="reg-button welcome-message">
        WELCOME, 
        @if(Common.isApproved)
        {
            @Html.ActionLink(CashOrCard.Helper.Common.CurrentUserName.Trim().Equals(string.Empty)? User.Identity.Name:CashOrCard.Helper.Common.CurrentUserName, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })
        }
        else
        {
            @Html.ActionLink(CashOrCard.Helper.Common.CurrentUserName.Trim().Equals(string.Empty)? User.Identity.Name:CashOrCard.Helper.Common.CurrentUserName, "ActiveAccount", "Login", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })
        }
    </div>
    <div class="borandlogin">
        <div class="bor-button manage-account">
            @if (Common.isApproved)
            {
                @Html.ActionLink("Manage Account","Index", "AdminDefault", routeValues: null, htmlAttributes: new { @class = "accountlink", title = "Manage Account"})
            }
            else
            {
                @Html.ActionLink("Manage Account","ActiveAccount", "Login", routeValues: null, htmlAttributes: new { @class = "accountlink", title = "Manage Account"})
            }
        </div>
        <div class="login-button logoff">
            @using (Html.BeginForm("LogOff", "Login", FormMethod.Post, new { id = "logoutForm" })) {
            @Html.AntiForgeryToken()
            <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
        }
        </div>
    </div>    
} else {
    <div class="reg-button">
        <div class="bor-button">@Html.ActionLink("Customer Register", "Index", "Login", new { type = "customer" }, htmlAttributes: new { Class = "crLink" })</div>
        <div class="login-button">@Html.ActionLink("Log in", "Index", "Login", routeValues: null, htmlAttributes: new { Class = "CRloginLink" })</div>
    </div>
    <div class="borandlogin">
        <div class="bor-button">@Html.ActionLink("BO Register", "Index", "Login", new { type = "business" }, htmlAttributes: new { Class = "borLink" })</div>
        <div class="login-button">@Html.ActionLink("Log in", "Index", "Login", routeValues: null, htmlAttributes: new { Class = "loginLink" })</div>
    </div>
}
